<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>更改超链接的背景样式</title>
<style type="text/css">
a {
  background-color: orange;
  border: 1px solid blue;
}
</style>
<script>
  function over(event) {
    var o = event.target.style;
    o.backgroundColor = "gray";
    o.border = "1px solid red";
  }
  function out(event) {
    var o = event.target.style;
    o.backgroundColor = "orange";
    o.border = "1px solid blue";
  }
</script>
</head>
<body>
  将指针悬停于超链接上方以改变超链接的样式（离开超链接后，样式将还原）
  <a href="https://www.w3.org/" style="text-decoration: none" onmouseover="over(event)"
    onmouseout="out(event)">W3C</a>
  <br>
</body>
</html>